//
//  BaseVC.m
//  timelyRain
//
//  Created by Jiafei Wei on 16/8/15.
//  Copyright © 2016年 Jiafei Wei. All rights reserved.
//

#import "BaseVC.h"
#import "TimeHeader.h"
@interface BaseVC ()<TimeHeaderDelegate>
{
    TimeHeader *head;
}
@property (weak, nonatomic) IBOutlet UIView *titleView;

@end

@implementation BaseVC

-(void)viewDidLoad{
    [super viewDidLoad];
    self.navigationController.navigationBarHidden=YES;
    head =[TimeHeader headerView];
    head.delegate =self;
    NSLog(@"BaseVCviewDidLoad");
}

-(void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:YES];
}
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:YES];
    self.navigationController.navigationBarHidden=YES;
}
-(void)setTitleView:(UIView *)view
{
    [view addSubview:head];
}

//抽取共同的部分
//pop动画交互 就行了啊
-(void)setTitleView:(UIView *)view withName:(NSString *)name
{
    head.ttitle.text=name;
    [view addSubview:head];//不知道多用可不可以啊
}
-(void)setTitleView:(UIView *)view withName:(NSString *)name with:(BOOL)isShow{
    if (isShow) {
        head.rightImage.hidden=NO;
        head.keeplable.hidden=YES;
    }
    head.ttitle.text=name;
    [view addSubview:head];
}
-(void)back{
    [self.navigationController popViewControllerAnimated:YES];
}
-(void)right{
    //保存
    [self keep];
}
@end
